import { createBrowserRouter, Navigate } from 'react-router-dom'
import Login from '../pages/login'
import Home from '../pages/home/index'
import Home2 from '../pages/zhome/index'

import HOC from './HOC'
//创建history的路由模式
const router = createBrowserRouter([
  {
    path: '/',
    element: <Navigate to="/login" />,
  },
  {
    path: '/login',
    element: <Login />,
  },
  {
    path: '/home',
    element: <Home />,
    children: [
      {
        path: '',
        element: <Navigate to="/home/CumulativeOverview" />,
      },
      {
        path: 'CumulativeOverview',
        element: <HOC href="/home/CumulativeOverview" />,
      },
      {
        path: 'particularstwo',
        element: <HOC href="/home/particularstwo" />,
      },
      {
        path: 'particularstwo1',
        element: <HOC href="/home/particularstwo1" />,
      },
      {
        path: 'examination',
        element: <HOC href="/home/examination" />,
      },
      {
        path: 'Details',
        element: <HOC href="/home/Details" />,
      },
      {
        path: 'Details2',
        element: <HOC href="/home/Details2" />,
      },
      {
        path: 'Details3',
        element: <HOC href="/home/Details3" />,
      },
      {
        path: 'Details1',
        element: <HOC href="/home/Details1" />,
      },
      {
        path: 'ArticleDetails',
        element: <HOC href="/home/ArticleDetails" />,
      },
      {
        path: 'Training',
        element: <HOC href="/home/Training" />,
      },
      {
        path: 'TrainingDetail',
        element: <HOC href="/home/trainingDetail" />,
      },
      {
        path: 'BusinessLicense',
        element: <HOC href="/home/BusinessLicense" />,
      },
      {
        path: 'TeacherManage',
        element: <HOC href="/home/TeacherManage" />,
      },
      {
        path: 'TeacherDetail',
        element: <HOC href="/home/TeacherDetail" />,
      },
      {
        path: 'TeacherDetail1',
        element: <HOC href="/home/TeacherDetail1" />,
      },
      {
        path: 'TeacherDetail2',
        element: <HOC href="/home/TeacherDetail2" />,
      },
      {
        path: 'TeacherDetail3',
        element: <HOC href="/home/TeacherDetail3" />,
      },
      {
        path: 'TeacherDetail4',
        element: <HOC href="/home/TeacherDetail4" />,
      },
      {
        path: 'TeacherDetail5',
        element: <HOC href="/home/TeacherDetail5" />,
      },
      {
        path: 'NewCourse',
        element: <HOC href="/home/NewCourse" />,
      },
      {
        path: 'courseDetail1',
        element: <HOC href="/home/courseDetail1" />,
      },
      {
        path: 'courseDetail2',
        element: <HOC href="/home/courseDetail2" />,
      },
      {
        path: 'courseDetail3',
        element: <HOC href="/home/courseDetail3" />,
      },
      {
        path: 'courseDetail4',
        element: <HOC href="/home/courseDetail4" />,
      },
      {
        path: 'studentFiling',
        element: <HOC href="/home/studentFiling" />,
      },
      {
        path: 'studentDetail',
        element: <HOC href="/home/studentDetail" />,
      },
      {
        path: 'particulars',
        element: <HOC href="/home/particulars" />,
      },
      {
        path: 'particulars0',
        element: <HOC href="/home/particulars0" />,
      },
      {
        path: 'particulars1',
        element: <HOC href="/home/particulars1" />,
      },
      {
        path: 'policyArticles',
        element: <HOC href="/home/policyArticles" />,
      },
      {
        path: 'Report',
        element: <HOC href="/home/Report" />,
      },
      {
        path: 'UserManage',
        element: <HOC href="/home/UserManage" />,
      },
      {
        path: 'setUp',
        element: <HOC href="/home/setUp" />,
      },
      {
        path: 'ApproveAlerts',
        element: <HOC href="/home/setUp/ApproveAlerts" />,
      },
      {
        path: 'Contact',
        element: <HOC href="/home/setUp/Contact" />,
      },
      {
        path: 'ReportTo',
        element: <HOC href="/home/setUp/Report" />,
      },
    ],
  },
  {
    path: '/zhome',
    element: <Home2 />,
    children: [
      {
        path: '',
        element: <Navigate to="/zhome/z-examination" />,
      },
      {
        path: 'z-examination',
        element: <HOC href="/zhome/z-examination" />,
      },
      {
        path: 'z-Details',
        element: <HOC href="/zhome/z-Details" />,
      },
      {
        path: 'z-TeacherManage',
        element: <HOC href="/zhome/z-TeacherManage" />,
      },
      {
        path: 'z-TeacherDetail',
        element: <HOC href="/zhome/z-TeacherDetail" />,
      },
      {
        path: 'z-studentFiling',
        element: <HOC href="/zhome/z-studentFiling" />,
      },
      {
        path: 'z-studentDetail',
        element: <HOC href="/zhome/z-studentDetail" />,
      },
      {
        path: 'z-policyArticles',
        element: <HOC href="/zhome/z-policyArticles" />,
      },
      {
        path: 'z-ArticleDetails',
        element: <HOC href="/zhome/z-ArticleDetails" />,
      },
      {
        path: 'z-Report',
        element: <HOC href="/zhome/z-Report" />,
      },
      {
        path: 'z-particularstwo',
        element: <HOC href="/zhome/z-particularstwo" />,
      },
      {
        path: 'z-particularstwo1',
        element: <HOC href="/zhome/z-particularstwo1" />,
      },
      {
        path: 'setUp',
        element: <HOC href="/zhome/setUp" />,
      },
      {
        path: 'ApproveAlerts',
        element: <HOC href="/zhome/setUp/ApproveAlerts" />,
      },
      {
        path: 'Contact',
        element: <HOC href="/zhome/setUp/Contact" />,
      },
      {
        path: 'ReportTo',
        element: <HOC href="/zhome/setUp/Report" />,
      },
    ],
  },
  {
    path: '*',
    element: <div>路径错误404</div>,
  },
])
export default router
